package com.meixiang.entity.shopping;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * 商品详情
 *
 * @author LZRUI
 */
public class GoodsDetailEntity implements Parcelable {

    private String goodsName; // 商品名称
    private String goodsStorePrice; // 商品店铺价格
    private String goodsMarketPrice; // 商品市场价格
    private String goodsImage; // 商品图片
    private List<String> goodsImageMore; // 更多图片
    private String goodsTransfreeCharge; // 运费承担
    private String salenum; // 商品销售数量
    private String cityName; // 发货地址

    public GoodsDetailEntity() {
    }

    public GoodsDetailEntity(String goodsName, String goodsStorePrice, String goodsMarketPrice, String goodsImage, List<String> goodsImageMore, String goodsTransfreeCharge, String salenum, String cityName) {
        this.goodsName = goodsName;
        this.goodsStorePrice = goodsStorePrice;
        this.goodsMarketPrice = goodsMarketPrice;
        this.goodsImage = goodsImage;
        this.goodsImageMore = goodsImageMore;
        this.goodsTransfreeCharge = goodsTransfreeCharge;
        this.salenum = salenum;
        this.cityName = cityName;
    }

    public String getGoodsName() {
        return goodsName == null ? "" : goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsStorePrice() {
        return goodsStorePrice == null ? "" : goodsStorePrice;
    }

    public void setGoodsStorePrice(String goodsStorePrice) {
        this.goodsStorePrice = goodsStorePrice;
    }

    public String getGoodsMarketPrice() {
        return goodsMarketPrice == null ? "" : goodsMarketPrice;
    }

    public void setGoodsMarketPrice(String goodsMarketPrice) {
        this.goodsMarketPrice = goodsMarketPrice;
    }

    public String getGoodsImage() {
        return goodsImage == null ? "" : goodsImage;
    }

    public void setGoodsImage(String goodsImage) {
        this.goodsImage = goodsImage;
    }

    public List<String> getGoodsImageMore() {
        return goodsImageMore;
    }

    public void setGoodsImageMore(List<String> goodsImageMore) {
        this.goodsImageMore = goodsImageMore;
    }

    public String getGoodsTransfreeCharge() {
        return goodsTransfreeCharge == null ? "" : goodsTransfreeCharge;
    }

    public void setGoodsTransfreeCharge(String goodsTransfreeCharge) {
        this.goodsTransfreeCharge = goodsTransfreeCharge;
    }

    public String getSalenum() {
        return salenum == null ? "" : salenum;
    }

    public void setSalenum(String salenum) {
        this.salenum = salenum;
    }

    public String getCityName() {
        return cityName == null ? "" : cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.goodsName);
        dest.writeString(this.goodsStorePrice);
        dest.writeString(this.goodsMarketPrice);
        dest.writeString(this.goodsImage);
        dest.writeStringList(this.goodsImageMore);
        dest.writeString(this.goodsTransfreeCharge);
        dest.writeString(this.salenum);
        dest.writeString(this.cityName);
    }

    protected GoodsDetailEntity(Parcel in) {
        this.goodsName = in.readString();
        this.goodsStorePrice = in.readString();
        this.goodsMarketPrice = in.readString();
        this.goodsImage = in.readString();
        this.goodsImageMore = in.createStringArrayList();
        this.goodsTransfreeCharge = in.readString();
        this.salenum = in.readString();
        this.cityName = in.readString();
    }

    public static final Creator<GoodsDetailEntity> CREATOR = new Creator<GoodsDetailEntity>() {
        @Override
        public GoodsDetailEntity createFromParcel(Parcel source) {
            return new GoodsDetailEntity(source);
        }

        @Override
        public GoodsDetailEntity[] newArray(int size) {
            return new GoodsDetailEntity[size];
        }
    };
}